<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>语文古诗文测验助手</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/test.css">
</head>
<body>
    <div class="container">
        <header class="test-header">
            <h1>语文古诗文题目测验</h1>
            <p>检验你对古诗文的理解和掌握程度</p>
            <button class="home-btn" onclick="goHome()">返回主页</button>
        </header>

        <!-- 测验选择页面 -->
        <div id="test-selection" class="test-selection">
            <h2>选择测验类型</h2>
            <!-- 词汇练习模块 -->
            <div class="test-module">
                <h3>📚 词汇练习</h3>
                <p>通过选择题练习，掌握古文词汇的多种含义</p>
                <div class="word-selection">
                    <div class="word-option" onclick="startTest('就')">
                        <h4>就</h4>
                        <p>5道题目</p>
                    </div>
                    <div class="word-option" onclick="startTest('假')">
                        <h4>假</h4>
                        <p>5道题目</p>
                    </div>
                    <div class="word-option" onclick="startTest('all')">
                        <h4>综合测验</h4>
                        <p>10道题目</p>
                    </div>
                </div>
            </div>
        
            <!-- 模拟题练习模块 -->
            <div class="test-module">
                <h3>📋 模拟题练习</h3>
                <p>通过完整的文章练习，提升综合理解能力</p>
                <div class="practice-selection">
                    <div class="practice-option" onclick="goToShizhongshan()">
                        <div class="practice-icon">📜</div>
                        <h4>《石钟山记》</h4>
                        <p>苏轼 · 宋</p>
                        <div class="practice-info">12道综合题目</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 测验进行页面 -->
        <div id="test-progress" class="test-progress hidden">
            <div class="progress-bar">
                <div class="progress-fill" id="progress-fill"></div>
            </div>
            <div class="question-info">
                <span id="current-question">1</span> / <span id="total-questions">5</span>
            </div>
            
            <div class="question-container">
                <h3 id="question-text"></h3>
                <div class="options" id="options-container">
                    <!-- 选项将通过JavaScript动态生成 -->
                </div>
                <button id="next-btn" class="next-btn" onclick="nextQuestion()" disabled>下一题</button>
            </div>
        </div>

        <!-- 测验结果页面 -->
        <div id="test-result" class="test-result hidden">
            <h2>测验完成！</h2>
            <div class="score-display">
                <div class="score-circle">
                    <span id="score-percentage">0%</span>
                </div>
                <p>你答对了 <span id="correct-count">0</span> / <span id="total-count">0</span> 题</p>
            </div>
            
            <div class="result-details" id="result-details">
                <!-- 详细结果将通过JavaScript生成 -->
            </div>
            
            <div class="result-actions">
                <button class="retry-btn" onclick="retryTest()">重新测验</button>
                <button class="home-btn" onclick="goHome()">返回主页</button>
                <button class="review-btn" onclick="goToReview()">去复习</button>
            </div>
        </div>
    </div>

    <script src="../js/data.js"></script>
    <script src="../js/test.js"></script>
    <script>
        function goHome() {
            window.location.href = '../index.html';
        }
        
        function goToShizhongshan() {
            window.location.href = 'shizhongshan.html';
        }
        
        function goToReview() {
            window.location.href = 'review.html';
        }
    </script>
</body>
</html> 